package com.niit.order.myImpl;

import com.niit.order.myInterface.Command;
import com.niit.order.pojo.Receiver;

/** 命令的具体实现类，它封装了具体的操作（即调用 Receiver 的 action() 方法）
 * @author yaojianfeng
 */
public class ConcreteCommand implements Command {
    private final Receiver receiver;

    public ConcreteCommand(Receiver receiver){
        this.receiver = receiver;
    }

    @Override
    public void execute() {
        this.receiver.action();
    }
}
